<?php
session_start();
      if (isset($_SESSION['k_username'])) {
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="/style.css" type="text/css" />
<title>Registrar Producto  Nuevo</title>
</head>

<body>
<?php 

  include('conexion.inc.php');
  $link = Conectarse();
mysql_select_db("gotica_ordencompras" ,$link);

?>
<div align="center" class="Estilo1">Registrar Producto Nuevo</div>
<form method="post" action="regproducto.php">
<table >
<tr>
<td>
  Nombre </td>
  <td>
  <input type="text" name="nombre" maxlength="100" size="100" />
  </td></tr>
<tr>

    <td>Descripcion</td>
  
   <td> <input type="text" name="descripcion" maxlength="100" size="100" />
   </td>
</tr>
<tr>
<td>Codigo</td>
   <td> <input type="text" name="codigo" maxlength="4"  />
   </td>
</tr>
<tr>
<td>Tipo Producto</td>
<?php

$sql = "SELECT * FROM tipoproducto";
$result = mysql_query($sql, $link);
echo "<td ><select name=\"tipoproducto\" />";

while ($row = mysql_fetch_array($result))
{
echo "<option value=\"".$row['idtipoprod']."\">";
echo $row['tipoprod'];
echo "</option>";
}
echo "</select></td>";
 ?>
</tr>
<tr>
<td>Proveedor</td>
<?php

$sql = "SELECT * FROM proveedor";
$result = mysql_query($sql, $link);
echo "<td ><select name=\"proveedor\" />";

while ($row = mysql_fetch_array($result))
{
echo "<option value=\"".$row['idproveedor']."\">";
echo $row['N_proveedor'];
echo "</option>";
}
echo "</select></td>";
 ?>
</tr>
<tr>

    <td>Precio</td>
<?php

$sql5 = "SELECT * FROM moneda";
$result5 = mysql_query($sql5, $link);
echo "<td ><select name=\"moneda\" />";

while ($row5 = mysql_fetch_array($result5))
{
echo "<option value=\"".$row5['idmoneda']."\">";
echo $row5['moneda'];
echo "</option>";
}
echo "</select>";
 ?>
  
  <input type="text" name="precio" size="10" />
   </td>
</tr>
<tr>
<td>
<input type="submit" value="enviar" name="enviar"  />
</td>
<td>
<input type="reset" value="Limpiar" />
</td>
</tr>
</table>
</form>
<div align="center" >
<a href="/ordenes.php">Inicio</a></div>
</body>
</html>
<?
}else
{
	echo "<SCRIPT LANGUAGE=\"javascript\">";
echo "location.href = \"index.php\"";
echo "</SCRIPT>";
	}
?>
